package cn.opopopo.design_pattern_learn.创建型.prototype;

// PrototypeDemo.java - 测试类
public class PrototypeDemo {
    public static void main(String[] args) {
        // 创建一个原型对象
        Student originalStudent = new Student("Alice", "Mathematics");
        System.out.println("Original: " + originalStudent);

        // 克隆对象
        Student clonedStudent = originalStudent.clone();
        System.out.println("Cloned: " + clonedStudent);

        // 修改克隆对象
        clonedStudent.setName("Bob");
        clonedStudent.setCourse("Physics");

        System.out.println("After modification:");
        System.out.println("Original: " + originalStudent);
        System.out.println("Cloned: " + clonedStudent);
    }
}